End the search if the window is closed.
authorMatthias Clasen <matthiasc@src.gnome.org>
Sun, 18 Jan 2009 15:50:29 +0000 (15:50 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 18 Jan 2009 15:50:29 +0000 (15:50 +0000)
       * demos/gtk-demo/search_entry.c: End the search if the window
        is closed.

        * demos/gtk-demo/search_entry.c:
        * demos/gtk-demo/entry_completion.c: Group the entry examples
        under "Entry".

svn path=/trunk/; revision=22132

ChangeLog
demos/gtk-demo/entry_completion.c
demos/gtk-demo/search_entry.c

index 885ee60ade0fdc31cdfbf806b51b3c994eb2a96e..96244e7695fd12138ff2b07b0fe4b4f11febe206 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-01-18  Matthias Clasen  <mclasen@redhat.com>
+
+       * demos/gtk-demo/search_entry.c: End the search if the window
+       is closed.
+
+       * demos/gtk-demo/search_entry.c:
+       * demos/gtk-demo/entry_completion.c: Group the entry examples
+       under "Entry".
+
 2009-01-18  Christian Dywan  <christian@twotoasts.de>
 
        Remove a redundant include from gtktoolbar.c
index fbcd856d0f5efa8f7ee0c36c602f8c84503ae0b2..5f1e327a21c5c944dae23665e57f3ce9c87273e3 100644 (file)
@@ -1,4 +1,4 @@
-/* Entry Completion
+/* Entry/Entry Completion
  *
  * GtkEntryCompletion provides a mechanism for adding support for
  * completion in GtkEntry.
index 5a23a095f23c9a6fd7e87f60b614652c7119409b..6269df2765ea42274a76d70f4d224fab2068fa6c 100644 (file)
@@ -1,4 +1,4 @@
-/* Search Entry 
+/* Entry/Search Entry 
  *
  * GtkEntry allows to display icons and progress information. 
  * This demo shows how to use these features in a search entry.
@@ -152,6 +152,19 @@ search_by_file (GtkWidget *item,
                                    "Search by file name\n"
                                    "Click here to change the search type");
 } 
+
+static void
+search_entry_destroyed (GtkWidget  *widget)
+{
+  if (finish_search_id != 0)
+    g_source_remove (finish_search_id);
+
+  if (search_progress_id != 0)
+    g_source_remove (search_progress_id);
+
+  window = NULL;
+}
+
                 
 GtkWidget *
 do_search_entry (GtkWidget *do_widget)
@@ -178,7 +191,7 @@ do_search_entry (GtkWidget *do_widget)
       g_signal_connect (window, "response",
                         G_CALLBACK (gtk_widget_destroy), NULL);
       g_signal_connect (window, "destroy",
-                        G_CALLBACK (gtk_widget_destroyed), &window);
+                        G_CALLBACK (search_entry_destroyed), &window);
 
       vbox = gtk_vbox_new (FALSE, 5);
       gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0);